package com.aijk.commons.lock.perf;


import com.aijk.commons.lock.RedisServer;
import com.aijk.perf.Perf;
import redis.clients.jedis.JedisCluster;

public class RedisPerf {

    private static final String LOCK_KEY = "lock.lock";
    private static final long LOCK_EXPIRE = 5 * 1000;

    public static void main(String[] args) throws Exception {

        JedisCluster cluster = RedisServer.getConfigCluster();

        Perf perf = new Perf() {

            @Override
            public TaskInThread buildTaskInThread() {
                return new TaskInThread() {

                    @Override
                    public void initTask() throws Exception {

                    }

                    @Override
                    public void doTask() throws Exception {
                        cluster.set("test:redis:qps", String.valueOf(System.currentTimeMillis()));
                    }
                };
            }

        };
        perf.loopCount = 100000;
        perf.threadCount = 50;
        perf.logInterval = 1000;
        perf.run();
        perf.close();

    }
}
